package com.msos.dao.getAccountDao;

import com.msos.model.customer.Customer;
import com.msos.utils.DBUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

/**
 * @ClassName: GetAccountDao
 * @Description: TODO
 * @Author: hsx
 * @Date: 2022/4/12 22:21
 * @Version: v1.0
 */
public class GetAccountDao {
    QueryRunner queryRunner = new QueryRunner(DBUtils.getDs());

    public Customer getCustomerByPhone(String phone) throws SQLException {
        return queryRunner.query("select * from customer where phone=?", new BeanHandler<>(Customer.class), phone);
    }
}
